package edu.neu.chenhan.fragment.news;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;
import edu.neu.chenhan.R; // 请根据实际情况修改包名

public class NewsDetailFragment extends Fragment {

    private TextView newsTitle;
    private TextView newsTime;
    private TextView newsReadCount;
    private WebView newsContentWebView;
    private ImageView backButton;
    private ImageView shareButton;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_news_detail, container, false);

        newsTitle = view.findViewById(R.id.news_title);
        newsTime = view.findViewById(R.id.news_time);
        newsReadCount = view.findViewById(R.id.news_read_count);
        newsContentWebView = view.findViewById(R.id.news_content_webview);
        backButton = view.findViewById(R.id.back_button);
        shareButton = view.findViewById(R.id.share_button);

        // 设置返回按钮的点击监听器
        backButton.setOnClickListener(v -> {
            // 在这里实现返回逻辑
        });

        // 设置分享按钮的点击监听器
        shareButton.setOnClickListener(v -> {
            // 在这里实现分享逻辑
        });

        return view;
    }
}